Creating a new protocol
How does it work?
The idea behind the SWAPP is fairly simple. We write protocols in Pipeline Pilot using the Connector 5 Components. This Protocol outputs an HTML file which is read by the SWAPP and parsed in the result page.
Here is an example protocol. You can build in Pipeline Pilot or open it directly under Discngine/TIBCO Spotfire Enabled Protocols/Client Automation/SWAPP Examples/Add SMILES to Data Table. It simply takes an input table containing molecular records, computes the SMILES of each record and adds them either as a new Column or a new Data Table. To test it, you can use for example the Data Table created by the Load Maybridge example protocol.

The protocol can be split into 4 steps.
- We use the Data Table Reader component. Each row will be read and passed to the next component.
- We process each row, calculate SMILES and add it to the input data.
- Depending on the user's choice, we either add the new columns to the input table or add a new table. Let's focus on the first option. We subsequently call the Add Data Columns Template and Table Plot components which respectively add the new columns and draw/update the Table plot.
- The SWAPP HTML Fragment component is used to translate all the instructions from the Connector Components to the corresponding calls of the Connector JavaScript API. The output HTML and javascript are written into an output.html file. This file will be loaded by the SWAPP, its HTML displayed in the result page and its JavaScript executed.
Registering a new protocol
Once your protocol is ready in Pipeline Pilot, it is time to add it to the SWAPP menu.
Click on the icon to open the registration modal. Then click "+ Register new Protocol". You will see the tree of Pipeline Pilot protocols. The example registered protocols can be found under Discngine/TIBCO Spotfire Enabled Protocols/Client Automation/SWAPP Examples. In there the protocol "Add SMILES to Data Table" has not yet been registered, let's use it as an example. Click on the protocol name to load the parameters list. Based on the input type the SWAPP will try to guess the most relevent input type (number, text, select, etc.).
- The first parameter, Data Table Name is set by default to Type: TIBCO Spotfire Data Table. Although it is a text field in Pipeline Pilot, because it contains the words "Data Table" the SWAPP automatically suggested the correct type. Let's leave it as is.
- The second parameter Destination is set by default to a Select input type as shown in the Overview / Default value section. Switch it to Radio Select and add some description so that your users know what this parameter is for.

Click "Next" at the bottom of the page. We now have to select where we want the link to appear in the menu and what name we want it to appear as. For example, select ChemoInformatics under Menu, and leave the Menu item name as is. If you wish you can write a description of that protocol which will be displayed above the form. Finally, click Add and your protocol will be registered in the menu.

You can now load the protocol from the menu and you should see the form displayed:
